<%@ Page Trace="true" %>
<%@ Register TagPrefix="Wrox" Namespace="WroxControls" 
			  Assembly="MyTextBox" %>

<script runat="server" language="C#">

	private void OnNameChanged( object sender, EventArgs e )
	{
		status.Text = "Value changed to " + name.Text;
	}

	private void OnPreRender( object sender, EventArgs e )
	{
		if ( name.Text.Length > 7 )
			name.Text = name.Text.Substring(0,7);
	}

</script>

<html>
<body>

<form runat="server">

	<H3>TextBox Control</H3>
	<P>Enter a value: <Wrox:MyTextBox id="name" runat="server" 
	                                  BackColor="Green"
									  ForeColor="Yellow"
									  BorderColor="Red"
	                                  OnTextChanged="OnNameChanged"
									  OnPreRender="OnPreRender" />
	<BR>
	
	<ASP:Button Text="Postback" runat="server" />

	<P>
	<ASP:Label runat="server" EnableViewState="False" id=status />

</form>

</body>
</html>
